package genDoc;

import org.jdom.Document;
import org.jdom.Element;

import command.CommandConstants;

public class VoiceAskResultDocGen {
	public static Document genDoc(String from, String to, boolean result){
		 Document doc = new Document();
		 Element root = new Element(CommandConstants.CMD_VOICE_ASK_RESULT);
		 root.setAttribute(CommandConstants.ATTR_FROM_USER_NAME, from);
		 root.setAttribute(CommandConstants.ATTR_TO_USER_NAME, to);
		 root.setAttribute(CommandConstants.ATTR_SUCCESS, result ? "1" : "0");
		 doc.setRootElement(root);
		 
		 return doc;
	}
}
